<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>colord - How do I use colord?</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
<link rel="shortcut icon" href="favicon.ico"/>
</head>
<body>

<p>Back to the <a href="index.html">main page</a></p>

<h1>How do I use colord?</h1>

<h2>Using the command line</h2>
<p>
The <code>colormgr</code> text-mode program allows you to interact with
colord on the command line. For example:
</p>
<pre>
[hughsie@hughsie-work ~]$ colormgr get-devices
Object Path: /org/freedesktop/ColorManager/devices/sysfs_Chicony_Electronics_Co___Ltd__Integrated_Camera
Created:        1310115220
Modified:       1310115220
Kind:           webcam
Model:          Webcam
Vendor:         Chicony Electronics
Serial:         /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/1-1.6:1.0/video4linux/video0
Colorspace:     rgb
Device ID:      sysfs-Chicony_Electronics_Co.__Ltd.-Integrated_Camera
Metadata:       CMS=colord

Object Path:    /org/freedesktop/ColorManager/devices/sane_Photosmart_B109a_m
Created:        1310115222
Modified:       1310115222
Kind:           scanner
Model:          Photosmart B109a-m
Vendor:         Hewlett Packard
Serial:         hpaio:/usb/Photosmart_B109a-m?serial=MY97J4210M05C7
Colorspace:     rgb
Device ID:      sane-Photosmart_B109a-m
Metadata:       CMS=colord

Object Path:    /org/freedesktop/ColorManager/devices/cups_Photosmart_B109a_m
Created:        1310115222
Modified:       1310115222
Kind:           printer
Model:          Photosmart-B109a-m
Vendor:         Hewlett Packard
Serial:         hp:/usb/Photosmart_B109a-m?serial=MY97J4210M05C7
Scope:          temp
Colorspace:     rgb
Device ID:      cups-Photosmart-B109a-m
Profile 1:      /org/freedesktop/ColorManager/profiles/GCM_HP_HP_Deskjet_d1300_Series_2010_02_25__
Profile 2:      /org/freedesktop/ColorManager/profiles/Photosmart_B109a_m_RGB__
Profile 3:      /org/freedesktop/ColorManager/profiles/Photosmart_B109a_m_Gray__
Metadata:       CMS=colord

Object Path:    /org/freedesktop/ColorManager/devices/xrandr_Lenovo_Group_Limited
Created:        1310115227
Modified:       1310115227
Kind:           display
Model:          4384BR2
Vendor:         Lenovo
Serial:         unknown
Scope:          temp
Colorspace:     rgb
Device ID:      xrandr-Lenovo Group Limited
Profile 1:      /org/freedesktop/ColorManager/profiles/icc_b634b0aed98b073e1f1e853dde389eef
Profile 2:      /org/freedesktop/ColorManager/profiles/icc_e3844d7f2dd36e1878acff8d77107aa4
Profile 3:      /org/freedesktop/ColorManager/profiles/icc_2304ec478dad248e0dd01ff2cc50940a
Profile 4:      /org/freedesktop/ColorManager/profiles/icc_d814dde3a76b05c47aa5fd16e7000639
Profile 5:      /org/freedesktop/ColorManager/profiles/icc_64eb9372fae294a7cf2e4c5bd3ab9590
Profile 6:      /org/freedesktop/ColorManager/profiles/icc_0f23f3fc3156fa9b2998c2ebe33ce54d
Metadata:       XRANDR_name=LVDS1

Object Path:    /org/freedesktop/ColorManager/devices/xrandr_Hewlett_Packard_HP_LP2480zx_3CM82200KV
Created:        1310115227
Modified:       1310115227
Kind:           display
Model:          HP LP2480zx
Vendor:         Hewlett Packard
Serial:         3CM82200KV
Scope:          temp
Colorspace:     rgb
Device ID:      xrandr-Hewlett Packard-HP LP2480zx-3CM82200KV
Profile 1:      /org/freedesktop/ColorManager/profiles/icc_d3b85708ae5843001de0801773b57246
Profile 2:      /org/freedesktop/ColorManager/profiles/icc_2ab7d3493c09663df7cbfa03cd8e006f
Metadata:       XRANDR_name=HDMI2
</pre>
<p>or</p>
<pre>
[hughsie@hughsie-work ~]$ colormgr --help
Usage:
  colormgr [OPTION...]

  create-device                      Create a device
  create-profile                     Create a profile
  delete-device                      Deletes a device
  delete-profile                     Deletes a profile
  device-add-profile                 Add a profile to a device
  device-get-default-profile         Gets the default profile for a device
  device-get-profile-for-qualifier   Returns all the profiles that match a qualifier
  device-make-profile-default        Makes a profile default for a device
  device-set-kind                    Sets the device kind
  device-set-model                   Sets the device model
  device-set-serial                  Sets the device serial
  device-set-vendor                  Sets the device vendor
  find-device                        Find a device
  find-device-by-property            Find a device that has a specific property
  find-profile                       Find a profile
  find-profile-by-filename           Find a profile by filename
  get-devices                        Gets all the color managed devices
  get-devices-by-kind                Gets all the color managed devices of a specific kind
  get-profiles                       Gets all the available color profiles
  get-sensor-reading                 Gets a reading from a sensor
  get-sensors                        Gets all the available color sensors
  get-standard-space                 Get a standard colorspace
  profile-set-filename               Sets the profile filename
  profile-set-qualifier              Sets the profile qualifier
  sensor-lock                        Locks the color sensor

Help Options:
  -h, --help       Show help options

</pre>

<h2>Using graphical tools:</h2>
<p>
GNOME and KDE both provides a rich set of GTK and QT tools for
automatically managing color devices and profiles.
See the <a href="screenshots.html">screenshots page</a> for more details.
</p>

<h2>Using libcolord:</h2>
<p>
The <a href="gtk-doc/">libcolord gobject library</a>
wraps the D-Bus interface in a nice glib-style API.
This makes designing programs that use libcolord can concentrate on
core functionality rather that the D-Bus and colord internals.
CdClient in libcolord can be used as easily as:
</p>
<pre>
CdClient *client;
GError *error;
GPtrArray *devices;
client = cd_client_new ();
devices = cd_client_get_devices_sync (client, cancellable, &amp;error);
g_object_unref (client);
g_ptr_array_unref (devices);
</pre>
<p>
The latest documentation for libcolord is available <a href="gtk-doc/">here</a>.
</p>

<h2>Using the raw D-Bus API:</h2>
<p>
Using the D-Bus methods and signals directly means that no glib or
gobject dependency is needed.
This is not difficult, although does require more code than just using
libcolord.
See these files for examples <a href="https://github.com/hughsie/colord/blob/master/examples/cd-dbus-create-device.c">cd-dbus-create-device.c</a> and <a href="https://github.com/hughsie/colord/blob/master/examples/cd-dbus-use-qualifier.c">cd-dbus-use-qualifier.c</a>.
The latest interface description is available in the
<a href="gtk-doc/ref-dbus.html">generated help</a> pages.
</p>

<p>Back to the <a href="index.html">main page</a></p>

<p class="footer">
 Copyright <a href="mailto:richard@hughsie.com">Richard Hughes 2011 - 2013</a><br/>
 <a href="http://validator.w3.org/check/referer">Optimized</a>
 for <a href="http://www.w3.org/">standards</a>.
</p>

</body>
</html>
